<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pymunk.Body</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pymunk-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://pymunk.googlecode.com/">pymunk API reference</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pymunk-module.html">Package&nbsp;pymunk</a> ::
        Class&nbsp;Body
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pymunk.Body-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Body</h1><p class="nomargin-top"></p>
<pre class="base-tree">
object --+
         |
        <strong class="uidshort">Body</strong>
</pre>

<hr />
<p>A rigid body</p>
<ul class="rst-simple">
<li>Use forces to modify the rigid bodies if possible. This is likely to be
the most stable.</li>
<li>Modifying a body's velocity shouldn't necessarily be avoided, but
applying large changes can cause strange results in the simulation.
Experiment freely, but be warned.</li>
<li>Don't modify a body's position every step unless you really know what
you are doing. Otherwise you're likely to get the position/velocity badly
out of sync.</li>
</ul>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pymunk.Body-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">mass</span>,
        <span class="summary-sig-arg">moment</span>)</span><br />
      Create a new Body</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__del__"></a><span class="summary-sig-name">__del__</span>(<span class="summary-sig-arg">self</span>)</span></td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pymunk.Body-class.html#apply_impulse" class="summary-sig-name">apply_impulse</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">j</span>,
        <span class="summary-sig-arg">r</span>=<span class="summary-sig-default"><code class="variable-group">(</code>0<code class="variable-op">, </code>0<code class="variable-group">)</code></span>)</span><br />
      Apply the impulse j to body at a relative offset (important!) r
from the center of gravity.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="reset_forces"></a><span class="summary-sig-name">reset_forces</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Zero both the forces and torques accumulated on body</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pymunk.Body-class.html#apply_force" class="summary-sig-name">apply_force</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">f</span>,
        <span class="summary-sig-arg">r</span>=<span class="summary-sig-default"><code class="variable-group">(</code>0<code class="variable-op">, </code>0<code class="variable-group">)</code></span>)</span><br />
      Apply (accumulate) the force f on body at a relative offset
(important!) r from the center of gravity.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pymunk.Body-class.html#apply_damped_spring" class="summary-sig-name">apply_damped_spring</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">b</span>,
        <span class="summary-sig-arg">anchor1</span>,
        <span class="summary-sig-arg">anchor2</span>,
        <span class="summary-sig-arg">rlen</span>,
        <span class="summary-sig-arg">k</span>,
        <span class="summary-sig-arg">dmp</span>,
        <span class="summary-sig-arg">dt</span>)</span><br />
      Apply a spring force between this body and b at anchors anchr1 and
anchr2 respectively.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pymunk.Body-class.html#slew" class="summary-sig-name">slew</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">pos</span>,
        <span class="summary-sig-arg">dt</span>)</span><br />
      Modify the velocity of the body so that it will move to the
specified absolute coordinates in the next timestep.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pymunk.Body-class.html#update_velocity" class="summary-sig-name">update_velocity</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">gravity</span>,
        <span class="summary-sig-arg">damping</span>,
        <span class="summary-sig-arg">dt</span>)</span><br />
      Default rigid body velocity integration function.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pymunk.Body-class.html#update_position" class="summary-sig-name">update_position</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">dt</span>)</span><br />
      Default rigid body position integration function.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pymunk.Body-class.html#local_to_world" class="summary-sig-name">local_to_world</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">v</span>)</span><br />
      Convert body local coordinates to world space coordinates</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pymunk.Body-class.html#world_to_local" class="summary-sig-name">world_to_local</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">v</span>)</span><br />
      Convert world space coordinates to body local coordinates</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Properties</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Body-class.html#mass" class="summary-name">mass</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Body-class.html#moment" class="summary-name">moment</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Body-class.html#angle" class="summary-name">angle</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Body-class.html#rotation_vector" class="summary-name">rotation_vector</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Body-class.html#torque" class="summary-name">torque</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Body-class.html#position" class="summary-name">position</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Body-class.html#velocity" class="summary-name">velocity</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Body-class.html#angular_velocity" class="summary-name">angular_velocity</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Body-class.html#force" class="summary-name">force</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Body-class.html#velocity_func" class="summary-name">velocity_func</a><br />
      The velocity callback function.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="pymunk.Body-class.html#position_func" class="summary-name">position_func</a><br />
      The position callback function.
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">mass</span>,
        <span class="sig-arg">moment</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </tr></table>
  
  Create a new Body
  <dl class="fields">
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="apply_impulse"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">apply_impulse</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">j</span>,
        <span class="sig-arg">r</span>=<span class="sig-default"><code class="variable-group">(</code>0<code class="variable-op">, </code>0<code class="variable-group">)</code></span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </tr></table>
  
  Apply the impulse j to body at a relative offset (important!) r
from the center of gravity. Both r and j are in world coordinates.
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>j</code></strong> ((x,y) or <a href="pymunk.vec2d.Vec2d-class.html" class="link">Vec2d</a>) - Impulse to be applied</li>
        <li><strong class="pname"><code>r</code></strong> ((x,y) or <a href="pymunk.vec2d.Vec2d-class.html" class="link">Vec2d</a>) - Offset the impulse with this vector</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="apply_force"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">apply_force</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">f</span>,
        <span class="sig-arg">r</span>=<span class="sig-default"><code class="variable-group">(</code>0<code class="variable-op">, </code>0<code class="variable-group">)</code></span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </tr></table>
  
  <p>Apply (accumulate) the force f on body at a relative offset
(important!) r from the center of gravity.</p>
<p>Both r and f are in world coordinates.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>f</code></strong> ((x,y) or <a href="pymunk.vec2d.Vec2d-class.html" class="link">Vec2d</a>) - Force in world coordinates</li>
        <li><strong class="pname"><code>r</code></strong> ((x,y) or <a href="pymunk.vec2d.Vec2d-class.html" class="link">Vec2d</a>) - Offset in world coordinates</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="apply_damped_spring"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">apply_damped_spring</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">b</span>,
        <span class="sig-arg">anchor1</span>,
        <span class="sig-arg">anchor2</span>,
        <span class="sig-arg">rlen</span>,
        <span class="sig-arg">k</span>,
        <span class="sig-arg">dmp</span>,
        <span class="sig-arg">dt</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </tr></table>
  
  <p>Apply a spring force between this body and b at anchors anchr1 and
anchr2 respectively.</p>
<p>Note: not solving the damping forces in the impulse solver causes
problems with large damping values. There is a new constraint type
DampedSpring that should be used instead.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>b</code></strong> (<a href="pymunk.Body-class.html" class="link">Body</a>) - The other body</li>
        <li><strong class="pname"><code>anchor1</code></strong> ((x,y) or <a href="pymunk.vec2d.Vec2d-class.html" class="link">Vec2d</a>) - Anchor point on the first body</li>
        <li><strong class="pname"><code>anchor2</code></strong> ((x,y) or <a href="pymunk.vec2d.Vec2d-class.html" class="link">Vec2d</a>) - Anchor point on the second body</li>
        <li><strong class="pname"><code>k</code></strong> (float) - The spring constant (force/distance) (Young's modulus)</li>
        <li><strong class="pname"><code>rlen</code></strong> (float) - The rest length of the spring</li>
        <li><strong class="pname"><code>dmp</code></strong> (float) - The damping constant (force/velocity)</li>
        <li><strong class="pname"><code>dt</code></strong> (float) - The time step to apply the force over.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="slew"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">slew</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">pos</span>,
        <span class="sig-arg">dt</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </tr></table>
  
  <p>Modify the velocity of the body so that it will move to the
specified absolute coordinates in the next timestep.</p>
<p>Intended for objects that are moved manually with a custom velocity
integration function.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="update_velocity"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">update_velocity</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">gravity</span>,
        <span class="sig-arg">damping</span>,
        <span class="sig-arg">dt</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </tr></table>
  
  <p>Default rigid body velocity integration function.</p>
<p>Updates the velocity of the body using Euler integration.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="update_position"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">update_position</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">dt</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </tr></table>
  
  <p>Default rigid body position integration function.</p>
<p>Updates the position of the body using Euler integration. Unlike the
velocity function, it's unlikely you'll want to override this
function. If you do, make sure you understand it's source code
(in Chipmunk) as it's an important part of the collision/joint
correction process.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="local_to_world"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">local_to_world</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">v</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </tr></table>
  
  Convert body local coordinates to world space coordinates
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>v</code></strong> ((x,y) or <a href="pymunk.vec2d.Vec2d-class.html" class="link">Vec2d</a>) - Vector in body local coordinates</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="world_to_local"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">world_to_local</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">v</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </tr></table>
  
  Convert world space coordinates to body local coordinates
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>v</code></strong> ((x,y) or <a href="pymunk.vec2d.Vec2d-class.html" class="link">Vec2d</a>) - Vector in world space coordinates</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== PROPERTY DETAILS ==================== -->
<a name="section-PropertyDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Property Details</span></td>
</tr>
</table>
<a name="mass"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">mass</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_get_mass" class="summary-sig-name" onclick="show_private();">_get_mass</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_set_mass" class="summary-sig-name" onclick="show_private();">_set_mass</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">mass</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="moment"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">moment</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_get_moment" class="summary-sig-name" onclick="show_private();">_get_moment</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_set_moment" class="summary-sig-name" onclick="show_private();">_set_moment</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">moment</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="angle"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">angle</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_get_angle" class="summary-sig-name" onclick="show_private();">_get_angle</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_set_angle" class="summary-sig-name" onclick="show_private();">_set_angle</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">angle</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="rotation_vector"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">rotation_vector</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_get_rotation_vector" class="summary-sig-name" onclick="show_private();">_get_rotation_vector</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="torque"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">torque</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_get_torque" class="summary-sig-name" onclick="show_private();">_get_torque</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_set_torque" class="summary-sig-name" onclick="show_private();">_set_torque</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">t</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="position"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">position</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_get_position" class="summary-sig-name" onclick="show_private();">_get_position</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_set_position" class="summary-sig-name" onclick="show_private();">_set_position</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">pos</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="velocity"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">velocity</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_get_velocity" class="summary-sig-name" onclick="show_private();">_get_velocity</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_set_velocity" class="summary-sig-name" onclick="show_private();">_set_velocity</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vel</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="angular_velocity"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">angular_velocity</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_get_angular_velocity" class="summary-sig-name" onclick="show_private();">_get_angular_velocity</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_set_angular_velocity" class="summary-sig-name" onclick="show_private();">_set_angular_velocity</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">w</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="force"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">force</h3>
  
  <dl class="fields">
    <dt>Get Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_get_force" class="summary-sig-name" onclick="show_private();">_get_force</a>(<span class="summary-sig-arg">self</span>)</span>
    </dd>
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_set_force" class="summary-sig-name" onclick="show_private();">_set_force</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">f</span>)</span>
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="velocity_func"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">velocity_func</h3>
  <p>The velocity callback function. The velocity callback function
is called each time step, and can be used to set a body's velocity.</p>
<blockquote>
<p>func(body, gravity, damping, dt) -&gt; None</p>
<dl class="rst-docutils">
<dt>Callback Parameters</dt>
<dd><dl class="rst-first rst-last rst-docutils">
<dt>body <span class="classifier-delimiter">:</span> <span class="rst-classifier"><a href="pymunk.Body-class.html" class="link">Body</a></span></dt>
<dd>Body that should have its velocity calculated</dd>
<dt>gravity <span class="classifier-delimiter">:</span> <span class="rst-classifier"><a href="pymunk.vec2d.Vec2d-class.html" class="link">Vec2d</a></span></dt>
<dd>The gravity vector</dd>
<dt>damping <span class="classifier-delimiter">:</span> <span class="rst-classifier">float</span></dt>
<dd>The damping</dd>
<dt>dt <span class="classifier-delimiter">:</span> <span class="rst-classifier">float</span></dt>
<dd>Delta time since last step.</dd>
</dl>
</dd>
</dl>
</blockquote>
  <dl class="fields">
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_set_velocity_func" class="summary-sig-name" onclick="show_private();">_set_velocity_func</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">func</span>)</span>
        - The velocity callback function.
    </dd>
  </dl>
</td></tr></table>
</div>
<a name="position_func"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">position_func</h3>
  <p>The position callback function. The position callback function
is called each time step and can be used to update the body's position.</p>
<blockquote>
<p>func(body, dt) -&gt; None</p>
<dl class="rst-docutils">
<dt>Callback Parameters</dt>
<dd><dl class="rst-first rst-last rst-docutils">
<dt>body <span class="classifier-delimiter">:</span> <span class="rst-classifier"><a href="pymunk.Body-class.html" class="link">Body</a></span></dt>
<dd>Body that should have its velocity calculated</dd>
<dt>dt <span class="classifier-delimiter">:</span> <span class="rst-classifier">float</span></dt>
<dd>Delta time since last step.</dd>
</dl>
</dd>
</dl>
</blockquote>
  <dl class="fields">
    <dt>Set Method:</dt>
    <dd class="value"><span class="summary-sig"><a href="pymunk.Body-class.html#_set_position_func" class="summary-sig-name" onclick="show_private();">_set_position_func</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">func</span>)</span>
        - The position callback function.
    </dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pymunk-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://pymunk.googlecode.com/">pymunk API reference</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Tue Jan 05 20:00:31 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
